#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton *button = new QPushButton(this);
    button->setText("按钮");
    button->move(200,200);
    connect(button,&QPushButton::clicked,this,&Widget::handleclick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleclick()
{
    // 按下按钮，改变标题
    this->setWindowTitle("喜欢自由");
}
